public class BankAccount2 {
    private double balance;
    public BankAccount2(double balance){
        this.balance=balance;
    }
    public void setBalance(double balance){
        this.balance=balance;
    }
    public double getBalance(){
        return balance;
    }
    //取钱
    public void withdraw(double amount){
        balance-=amount;
    }
//    存款
    public void deposit(double amount){
        balance+=amount;
    }
}
